import { dataCompanyAxios } from '@/utils/request.ts'

export const postCompanyInfoDynamicPage = (data: {
  companyCode: string
  current: number
  eventSubType: string
  eventType: string
  keyword: string
  pageSize: number
}): Promise<{
  total: number
  list: Array<{
    companyCode: string
    companyId: string
    companyName: string
    eventSegment: string
    eventShortTitle: string
    eventSource: string
    eventSubType: string
    eventTitle: string
    eventType: string
    id: string
    occurDate: string
    navigateFirstPage: number
    navigateLastPage: number
    navigatePageNums: Array<any>
    navigatePages: number
    nextPage: number
    pageNum: number
    pageSize: number
    pages: number
    prePage: number
    size: number
    startRow: number
    total: number
  }>
  // 其他字段...
}> => {
  return dataCompanyAxios(
    {
      url: '/companyInfo/dynamic/page',
      method: 'post',
      data: data
    },
    {
      extra_handle_response: true
    }
  )
}

export const postCompanyInfoDynamicQueryCount = (data: {
  companyCode: string
  current: number
  eventSubType: string
  eventType: string
  keyword: string
  pageSize: number
}): Promise<any> => {
  return dataCompanyAxios(
    {
      url: '/companyInfo/dynamic/queryCount',
      method: 'post',
      data: data
    },
    {
      extra_handle_response: true
    }
  )
}

export const postCompanyInfoDynamicQueryCountSubType = (data: {
  companyCode: string
  current: number
  eventSubType: string
  eventType: string
  keyword: string
  pageSize: number
}): Promise<any> => {
  return dataCompanyAxios(
    {
      url: '/companyInfo/dynamic/queryCountSubType',
      method: 'post',
      data: data
    },
    {
      extra_handle_response: true
    }
  )
}

export const postStdsParameterTreeList = (data: { current: number; name: string; pageSize: number }): Promise<Array<any>> => {
  return dataCompanyAxios(
    {
      url: '/stdsParameter/treeList',
      method: 'post',
      data: data
    },
    {
      extra_handle_response: true
    }
  )
}
